

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using JTC.MiniCommerce.Core;
using JTC.MiniCommerce.Localization;
using SubSonic.Utilities;

namespace JTC.MiniCommerce.Web.admin {

  public partial class errorlogdetails : System.Web.UI.Page {

    #region Member Variables

    private int logId = 0;

    #endregion

    #region Page Events

    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
    protected void Page_Load(object sender, EventArgs e) {
      try {
        logId = Utility.GetIntParameter("logId");
        if (logId > 0) {
          SetErrorLogDetailsProperties();
          Log log = new Log(logId);
          lblLogDateDisplay.Text = log.LogDate.ToLongDateString();
          lblLogLevelDisplay.Text = log.LogLevel;
          lblLogMessageDisplay.Text = log.LogMessage;
          txtLogInfoDisplay.Text = log.LogInfo;
        }
      }
      catch (Exception ex) {
        Logger.Error(typeof(errorlogdetails).Name + ".Page_Load", ex);
        Master.MessageCenter.DisplayCriticalMessage(LocalizationUtility.GetCriticalMessageText(ex.Message));
      }
    }

    #endregion

    #region Methods

    #region Private

    /// <summary>
    /// Sets the error log details properties.
    /// </summary>
    private void SetErrorLogDetailsProperties() {
      LocalizationUtility.AddLabelText(lblErrorLogDetail);
      LocalizationUtility.AddLabelText(lblLogDate);
      LocalizationUtility.AddLabelText(lblLogLevel);
      LocalizationUtility.AddLabelText(lblLogMessage);
      LocalizationUtility.AddLabelText(lblLogInfo);
    }

    #endregion

    #endregion

  }
}
